using System;
using System.Collections.Generic;
using System.Text;
using CDE_Model;

namespace XML_Indexing.PRIX
{
    public class PRIX : IXMLIndex
    {
        private List<PruferSequence> _prufers;
        private Element _node;

        public Element Node
        {
            get { return _node; }
            set { _node = value; }
        }

        #region IXMLIndex Members

        public Element GetByXPathExpression(string _path)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public Boolean CreateIndex(Element _ele)
        {
            foreach (PruferSequence p in _prufers)
            {
                if (p.RootElement.Equals(_ele))
                {
                    return true;
                }
            }

            _prufers.Add(new PruferSequence(_ele, 0));
            return false;
        }

        public Boolean CreateIndex(Document _doc)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public Boolean CreateIndex(Collection _col)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public Boolean CreateIndex(List<Element> _eleList)
        {
            Boolean isSuccessful = true;

            foreach (Element e in _eleList)
            {
                isSuccessful = CreateIndex(e);
            }

            return isSuccessful;
        }

        public IXMLIndex FindChild(string genericIdentifier)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IXMLIndex Members


        public List<IXMLIndex> FindChildren(string genericIdentifier)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
